package com.monicaca.service;


import com.monicaca.bean.INV_LOG;
import com.monicaca.dao.INV_LOGDAO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class INV_LOGService {
	@Autowired
	private INV_LOGDAO INV_LOGDAO;
	
	public INV_LOG findByInvId(int INV_LOGDAOId) {  
        return INV_LOGDAO.findById(INV_LOG.class, INV_LOGDAOId);  
    }  
	/*public RKD findByRKDName(RKD RKD) {
        return RKDDAO.findByName(RKD);
    }*/


    public List<INV_LOG> findAll() {  
        return INV_LOGDAO.findAll(INV_LOG.class);  
    }
    @Transactional
    public int count4(){
        return INV_LOGDAO.count4();
    }

    @Transactional  
    public void createINV_LOG(INV_LOG INV_LOG) {  
    	INV_LOGDAO.save(INV_LOG);  
    }  
  
    @Transactional(readOnly = false, propagation = Propagation.REQUIRES_NEW )

    public void updateINV_LOGDAO(INV_LOGDAO INV_LOGDAO) {  
    	INV_LOGDAO.update(INV_LOGDAO);  
    }  
  
    @Transactional  
    public void deleteINV_LOGDAO(int INV_LOGDAOId) {  
    	INV_LOGDAO.deleteById(INV_LOGDAO.class, INV_LOGDAOId);  
    }  
  
    @Transactional  
    public void deleteINV_LOGDAO(INV_LOGDAO INV_LOGDAO) {  
    	INV_LOGDAO.delete(INV_LOGDAO);  
    }  
}
